package com.dk.page;

import java.io.Serializable;
import java.util.List;

public class PageBean<T> implements Serializable {
	private int totalCount;//总条数
	private int totalPage;//总页数
	private int startIndex;// 起始索引
	private int pageSize;// 每页显示条数 5
	private int pageNumber;// 当前页数 1
	private List<T> list;// 每页所展示的商品信息
	public int getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}
	public int getTotalPage() {
		return totalPage = (totalCount % pageSize == 0 ? totalCount / pageSize : totalCount / pageSize + 1);
	}
	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}
	public int getStartIndex() {//
		startIndex = (pageNumber - 1) * pageSize;
		return startIndex;
	}
	public void setStartIndex(int startIndex) {
		this.startIndex = startIndex;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getPageNumber() {
		return pageNumber;
	}
	public void setPageNumber(int pageNumber) {
		this.pageNumber = pageNumber;//1
	}
	public List<T> getList() {
		return list;
	}
	public void setList(List<T> list) {
		this.list = list;
	}
	@Override
	public String toString() {
		return "PageBean [totalCount=" + totalCount + ", totalPage=" + totalPage + ", startIndex=" + startIndex
				+ ", pageSize=" + pageSize + ", pageNumber=" + pageNumber + ", list=" + list + "]";
	}
	
	
	
}
